package com.company.cloud.user.modules.app.service;

import com.company.cloud.common.bean.LoginSimpleUserInfo;
import com.company.cloud.common.bean.LoginUserInfo;
import com.company.cloud.user.modules.app.models.ThirdUserEntity;
import com.company.cloud.user.modules.app.models.User2ThirdModel;
import com.company.cloud.user.modules.base.entity.ThirdUserInfo;
import com.company.cloud.user.modules.base.entity.UserInfo;
import com.company.common.server.constant.LoginThirdChannelEnum;

public interface UserLoginService {

    /**
     * 根据手机号获取用户
     */
    public UserInfo getUserByMobile(String companyNo, String mobile);

    /**
     * 根据用户名获取用户
     */
    public UserInfo getUserByUserName(String companyNo, String userName);

    /**
     * 根据用户ID获取用户
     */
    public UserInfo getUserById(Integer id);

    /**
     * 根据手机号获取用户-注册
     */
    public UserInfo getRegUserByMobile(String companyNo, String mobile);

    /**
     * 根据用户名获取用户-注册
     */
    public UserInfo getRegUserByUserName(String companyNo, String userName);

    /**
     * 根据用户ID获取用户-注册
     */
    public UserInfo getRegUserById(Integer id);

    /**
     * 根据手机号和密码登录
     */
    public UserInfo loginByUserName(String companyNo, String userName, String password);

    /**
     * 根据用户名和密码登录
     */
    public UserInfo loginByMobile(String companyNo, String mobile, String password);

    /**
     * 根据第三方用户OpenId登录
     */
    public User2ThirdModel loginByThird(String companyNo, LoginThirdChannelEnum channel, String openId, String ip, boolean isReg);

    /**
     * 登录
     */
    public LoginUserInfo login(UserInfo userInfo);

    /**
     * 登录
     */
    public LoginUserInfo login(UserInfo userInfo, String token);

    /**
     * 登录
     */
    public LoginUserInfo login(UserInfo userInfo, ThirdUserInfo thirdUser, ThirdUserEntity thirdUserEntity);

    /**
     * 登录
     */
    public LoginUserInfo login(UserInfo userInfo, ThirdUserInfo thirdUser, String token, ThirdUserEntity thirdUserEntity);

    /**
     * 登出
     */
    public void logout(LoginSimpleUserInfo userInfo);

    /**
     * 更新第三方用户的UserId
     */
    void updateThirdUserId(LoginThirdChannelEnum channel, String openId, Integer id);

    /**
     * 更新用户手机号
     **/
    void updateUserInfo(UserInfo userInfo);

}
